package io;

import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;

/**
 * @Author:Cjj
 * @Date: 2025/6/24
 */
public class ByteStreamDemo3 {
    public static void main(String[] args) throws IOException {
        /**
         * void write(int b)
         * void write(byte[] b)
         * void write(byte[] b,int off,int len)
         */

        //1.创建对象
     FileOutputStream fos=   new FileOutputStream("IO/src/test/Map");
       //2.写出数据
        fos.write(97); //a
        fos.write(98); //b

        byte[] bytes={97,98,99,100,101};
        fos.write(bytes,1,2);

        //3.释放资源
        fos.close();
    }
}
